Make someone angry, especially deliberately, as in Teenagers really know how to pull their parents' chains. [
c. 1960 ]
Both usages allude to the literal sense of chain-pulling, that is, “causing someone to do something, as though activated by a chain.”